<div id="main-content">
    <div class="container">
    	<div class="row">
    		<div id="content" class="col-lg-12">
    			<!-- PAGE HEADER-->
    			<div class="row">
    				<div class="col-sm-12">
                        <div class="page-header">
    						<div class="clearfix">
    							<h3 class="content-title pull-left">Thêm danh mục mới</h3>
    						</div>
    						<div class="description">Xin mời nhập theo mẫu bên dưới</div>
   					    </div>
   				     </div>
    			</div>
                <!-- DATA TABLES -->
						<div class="row">
							<div class="col-md-12">
								<!-- BOX -->
								<div class="box border green">
									<div class="box-title">
										<h4><i class="fa fa-table"></i>Thêm danh mục mới</h4>
										<div class="tools hidden-xs">
											<a href="javascript:;" data-toggle="tooltip" title="Ẩn đi" class="collapse">
												<i class="fa fa-chevron-up"></i>
											</a>
										</div>
									</div>
									<div class="box-body">
                                        <!-- Start Form -->
                                         <?php echo validation_errors(); ?>
                                        <form method="POST" class="form-horizontal row-border" action="<?php echo base_url().'admin/xuly/article_category/list/'.$this->uri->segment(5);?>">
										  <div class="form-group">
											 <label class="col-md-2 control-label">Tiêu đề:</label> 
											 <div class="col-md-10"><input name="title" id="title" onkeyup="locdau();" type="text" value="<?php if(!empty($data)){echo $data->title;};?>" class="form-control" /></div>
										      <!-- Node // Đặt id input là title và id alias là alias và onkeyup="locdau();" sẽ tự động chạy function alias -->
                                          </div>
                                          <div class="form-group">
											 <label class="col-md-2 control-label">Alias:</label> 
											 <div class="col-md-10"><input id="alias" name="alias"value="<?php if(!empty($data)){echo $data->alias;};?>" type="text" class="form-control" /></div>
										  </div>
                                          <div class="form-group">
											 <label class="col-md-2 control-label">Hình ảnh:</label> 
											 <div class="col-md-8"><input readonly="" id="xFilePath" value="<?php if(!empty($data)){echo $data->image;}else echo '';?>" type="text" name="image" class="form-control" /></div><a href="javascript:void(0);" onclick="BrowseServer();" class="btn btn-success"><i class="fa fa-picture-o"></i>&nbsp;&nbsp;&nbsp;Tải ảnh lên</a>
										  </div>
                                          <div class="form-group">
											 <label class="col-md-2 control-label">Sắp xếp:</label> 
											 <div class="col-md-10"><input value="<?php if(!empty($data)){echo $data->order;}else echo '0';?>" name="order" type="text" class="form-control" /></div>
										  </div>
                                          <div class="form-group">
											 <label class="col-md-2 control-label">Danh mục:</label> 
											 <div class="col-md-10">
                                                <select name="parentid" id="input" class="form-control">
                                                <option id="0" value="0">-- Danh mục gốc --</option>
                                                        <?php if($cat) {
                                                            echo $cat;
                                                        }?> 
                                                </select>
                                             </div>
										  </div>
                                          <div class="form-group">
											 <label class="col-md-2 control-label">Trạng thái:</label> 
											 <div class="col-md-10">
                                                <select name="publish" id="input" class="form-control">
                                                <option <?php if(!empty($data)){if($data->publish=='1')echo 'selected="selected"';} ?> value='1'>Hiện</option> 
                                                <option <?php if(!empty($data)){if($data->publish=='0')echo 'selected="selected"';} ?> value='0'>Ẩn</option> 
                                                </select>
                                             </div>
										  </div>
                                          <div class="form-group">
											 <label class="col-md-2 control-label">Vị trí:</label> 
											 <div class="col-md-10">
                                                <select name="position" id="input" class="form-control">
                                                        <option <?php if(!empty($data)){if($data->position=='0')echo 'selected="selected"';} ?> value='0'>Menu top</option>';
                                                        <option <?php if(!empty($data)){if($data->position=='1')echo 'selected="selected"';} ?> value='1'>Menu left</option>';
                                                        <option <?php if(!empty($data)){if($data->position=='2')echo 'selected="selected"';} ?> value='2'>Menu bottom</option>';   
                                                </select>
                                             </div>
										  </div>
                                          <div class="form-group">
													 <label class="col-md-2 control-label">Mô tả danh mục:</label> 
													 <div class="col-md-10"><textarea rows="3" cols="5" name="metades" class="form-control"><?php if(!empty($data)){echo $data->metades;};?></textarea></div>
										  </div>
                                          <div class="form-group">
													 <label class="col-md-2 control-label">Từ khóa Seo danh mục:</label> 
													 <div class="col-md-10"><textarea rows="3" cols="5" name="metakey" class="form-control"><?php if(!empty($data)){echo $data->metakey;};?></textarea></div>
										  </div>
                                          <input class="guidulieu btn btn-success" type="submit" value="Lưu"/>
										</form>
                                        <!-- End Form -->
                                    </div>
								</div>
								<!-- /BOX -->
							</div>
						</div>
						<!-- /DATA TABLES -->
    			<!-- /PAGE HEADER -->
    		</div>
    	</div>
    </div>
</div>